#ifndef CONFIG_H
#define CONFIG_H

#include <QString>
#include <QDebug>
#include <QDateTime>
#include <QDataStream>

#include "Model/BimosSensorPressure.h"
#include "Model/bimossensorabsolute.h"
#include "Model/bimossensortemperature.h"
#include "Model/bimossensorgroup.h"

#define UPPER_PRESSURE_THRESHOLD 1
#define LOWER_PRESSURE_THRESHOLD 0.4

#define SENSOR_COUNT 14

#define SENSOR_ABSOLUTE_ORDINAL 14
#define SENSOR_TEMPERATUR_ORDINAL 15

#define GROUP_COUNT 4

#define CONFIG_SUFFIX ".bimosConfig"


class Config
{
public:
    Config();
    Config( const Config& other );
    Config& operator=( const Config& other );

    // Sensors
    QMap<int, BimosSensorPressure*> sensorList;
    BimosSensorAbsolute* absolutSensor;
    BimosSensorTemperature* temperaturSensor;
    BimosSensorGroup* sensorGroups[GROUP_COUNT];

    // Setter
    void setProjectName(QString prName);
    void setCreateTime(QDateTime createTime);
    void setSampleTime(int sTime);
    void setLogTime(int sTime);

    // Getter
    QString getProjectName();
    QDateTime getCreateTime();
    int getSampleTime();
    int getLogTime();

    // access private field for serialization
    friend QDataStream& operator<<(QDataStream &outStream, const Config &data);
    friend QDataStream& operator>>(QDataStream &inStream, Config &data);


private:

    QString projectName;
    QDateTime createdTime;
    quint32 sampleTime;
    quint32 logTime;

//friend class QDataStream;

};





#endif // Config_H
